import { pget, ppostJson } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';

// 字典列表查询
export function getTableList(query?: any) {
  return pget(
    `${modalApi.common}/shopec-systembase/basedictionary/parent-list`,
    query,
  );
}

// 新增字典
export function addDict(data: any) {
  return ppostJson(
    `${modalApi.common}/shopec-systembase/basedictionary/saveBaseDictionary`,
    data,
  );
}

// 编辑字典
export function editDict(data: any) {
  return ppostJson(
    `${modalApi.common}/shopec-systembase/basedictionary/updateBaseDictionary`,
    data,
  );
}

// 删除字典
export function delectDict(query?: any) {
  return pget(
    `${modalApi.common}/shopec-systembase/basedictionary/remove`,
    query,
  );
}

// 查看字典
export function viewDict(query?: any) {
  return pget(
    `${modalApi.common}/shopec-systembase/basedictionary/detail`,
    query,
  );
}

// 字典子集列表查询
export function getchildList(query?: any) {
  return pget(
    `${modalApi.common}/shopec-systembase/basedictionary/child-list`,
    query,
  );
}
// // 删除字典
// export function delectDict(data: any) {
//   return ppostJson(`${modalApi.common}/dict/remove`, data);
// }
